package ke06.aufgabe4;

import java.io.File;
import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class XMLParsingSAX {

	public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException {
		SAXParserFactory factory = SAXParserFactory.newInstance();
		SAXParser saxParser = factory.newSAXParser();
		DefaultHandler handler = new PartyHandler();
		saxParser.parse(new File("partyGen.xml"), handler);
		
		System.out.println("Elements: "+PartyHandler.elementCount);
		System.out.println("Attributes: "+PartyHandler.attributeCount);
	}

}
